/*
 * @lc app=leetcode.cn id=1 lang=golang
 *
 * [1] 两数之和
 */

// @lc code=start
func twoSum(nums []int, target int) []int {
    mp := map[int]int{}

	for i, num := range nums {
		if _, ok := mp[target - num]; ok {
			return []int{mp[target - num], i}
		} else {
			mp[num] = i
		}
	}
	return []int{-1, -1}
}
// @lc code=end

